﻿using System;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI.Selection;
using YArchitech.Revit;

namespace YArchitech.HVAC
{
	public class DuctTerminalVerticalSelectionFilter : ISelectionFilter
	{
		public bool AllowElement(Element elem)
		{
			return elem is FamilyInstance && elem.Category.Id.IntegerValue == -2008013 && YJKRevitTools.GetElementConnector((Domain)1, elem).CoordinateSystem.BasisZ.Z == 0.0;
		}

		public bool AllowReference(Reference reference, XYZ position)
		{
			return false;
		}
	}
}
